package com.visec.hdy.log;

import java.util.List;

import com.visec.hdy.hadoop.standard.Inquiry;

public interface Log<V> {

	public void save(V o);

	public Find<V> find(long start, long end);

	public void close();

	public class Find<T> {
		Inquiry<String, T> inquiry;

		public Find(Inquiry<String, T> inquiry) {
			this.inquiry = inquiry;
		}

		public List<T> getPage(int page, int length, Class<T> c) {
			this.inquiry.seek((page - 1L) * length);
			return this.inquiry.next(length, c);
		}

		public List<T> get(int size, Class<T> c) {
			return this.inquiry.next(size, c);
		}

		public long getCount() {
			return this.inquiry.count();
		}

	}

}
